<?php
namespace app\web\model;



/**
 * 技师
 * @package app\basic\model
 */
class TechnicianJob extends Common 
{
    
    public static function add($id,array $job_ids)
    {
        if(!$job_ids) return true;
        self::where(['technician_id'=>$id])->update(['delete_time'=>time()]);
        $arr = [];
        foreach ($job_ids as $key => $value) {
            $arr[$key]['technician_id'] = $id;
            $arr[$key]['job_id'] = $value;
            $arr[$key]['status'] = 0;
        }
        $res = (new self())->saveAll($arr);
        return $res;
    }
}